package com.atmilan.quartz.model.dto.efasion;

import java.math.BigDecimal;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;

/**
 * 易时尚商品
 * @author daigb
 * @date:  2022-06-14 16:39
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class EfasionProductResDTO {
    /**
     * 错误代码
     * 1001：重复订单号
     * 1002：订单金额不符
     * 1003：没有订单商品信息
     */
    private Integer code;

    /**
     * 错误内容
     */
    private String message;

    /**
     * 分页信息
     */
    private Integer count;

    /**
     * 商品列表
     */
    @JsonProperty(value = "data")
    private List<Product> product;

    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Product {

        @JsonProperty(value = "id")
        private Integer productId;
        
        @JsonProperty(value = "image")
        private String image;
        
        @JsonProperty(value = "sliderImage")
        private String sliderImage;
        
        @JsonProperty(value = "storeName")
        private String storeName;
        
        @JsonProperty(value = "storeInfo")
        private String storeInfo;
        
        @JsonProperty(value = "keyword")
        private String keyword;
        
        @JsonProperty(value = "cateId")
        private String cateId;
        
        @JsonProperty(value = "price")
        private BigDecimal price;
        
        @JsonProperty(value = "otPrice")
        private BigDecimal otPrice;
        
        @JsonProperty(value = "postage")
        private BigDecimal postage;
        
        @JsonProperty(value = "unitName")
        private String unitName;
        
        @JsonProperty(value = "stock")
        private Integer stock;
        
        @JsonProperty(value = "tempId")
        private Integer tempId;
        
        @JsonProperty(value = "brandId")
        private Integer brandId;
        
        @JsonProperty(value = "barCode")
        private String barcode;

        @JsonProperty(value = "attrValue")
        private List<ProductSku> skus;
    }

    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class ProductSku {
    	
        @JsonProperty(value = "id")
        private Integer skuId;
        
        @JsonProperty(value = "sourceSkuId")
        private String sourceSkuId;
        
        @JsonProperty(value = "productId")
        private Integer productId;
        
        @JsonProperty(value = "suk")
        private String suk;
        
        @JsonProperty(value = "stock")
        private Integer stock;
        
        @JsonProperty(value = "price")
        private BigDecimal price;
        
        @JsonProperty(value = "image")
        private String image;
        
        @JsonProperty(value = "otPrice")
        private BigDecimal otPrice;

    }

}
